//
//  CreatRoomViewController.m
//  who
//
//  Created by yunqi-dev-1 on 15/8/26.
//  Copyright (c) 2015年 yunqi-dev-1. All rights reserved.
//

#import "CreatRoomViewController.h"
#import "DXData.h"
#import "AppDelegate.h"
#import "RoomDetialController.h"

@implementation CreatRoomViewController
- (void)viewDidLoad
{
    [super viewDidLoad];
    self.roomPassWordTextField.delegate = self;
    self.title = @"路飞";
}

- (IBAction)clickCreatRoom:(UIButton *)sender {
    [self performSegueWithIdentifier:@"creat-room" sender:self];
}

- (IBAction)disMissView:(UIBarButtonItem *)sender {
    DXData *data = [DXData sharedInstance];
    data.token = @"";
    [data save];
    
    [[AppDelegate getAppDelegate] refreshRootViewControllerWithStoryboardName:@"login" animation:YES];
}

- (void)viewWillAppear:(BOOL)animated
{
    
}

- (IBAction)clickPlayGame:(UIButton *)sender {
    [self performSegueWithIdentifier:@"go-to-room" sender:self];
}

- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
{
    [self.roomPassWordTextField resignFirstResponder];
    [self.roomIdTextField resignFirstResponder];
}

- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    if ([segue.identifier isEqualToString:@"creat-room"]) {
        RoomDetialController *roomController = (RoomDetialController *) segue.destinationViewController;
        roomController.can = @"傻逼灿";
    }
}
@end
